import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

public class ServletA extends HttpServlet {

    protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws SecurityException, IOException{
        ServletContext context = this.getServletContext();
        context.setAttribute("user","zhangsan");
    }
}
